import axios from "@/model/axios";
import api from "@/model/api";


export const userLogin = (data) => axios({
    method: "post",
    url: api.userinfo.login,
    data
});
export const userRegister = (data) => axios({
    method: "post",
    url: api.userinfo.register,
    data
});
export const userAddress = (params) => axios({
    method: "get",
    url: api.userinfo.address,
    params
});
export const userInfo = () => axios({
    method: "get",
    url: api.userinfo.info,
    headers: {
        "Authorization": window.localStorage.getItem("token")
    }
})
export const userUpdate = (data) => axios({
    method: "put",
    url: api.userinfo.update,
    data,
    headers: {
        "Authorization": window.localStorage.getItem("token")
    }
})
export const userUpload = (data) => axios({
    method: "post",
    url: api.userinfo.upload,
    data,
    headers: {
        "Authorization": window.localStorage.getItem("token")
    }
})
export const userReset = (data) => axios({
    method: "put",
    url: api.userinfo.reset,
    data,
    headers: {
        "Authorization": window.localStorage.getItem("token")
    }
})
export const userFeekback = (params) => axios({
    method: "get",
    url: api.userinfo.feedback,
    params,
    headers: {
        "Authorization": window.localStorage.getItem("token")
    }
})
export const userAddFeekback = (data) => axios({
    method: "post",
    url: api.userinfo.addfeedback,
    data,
    headers: {
        "Authorization": window.localStorage.getItem("token")
    }
})
export const userOrder = (params) => axios({
    method: "get",
    url: api.userinfo.order,
    params,
    headers: {
        "Authorization": window.localStorage.getItem("token")
    }
})